home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Windows.h < prev   
Encoding:
C/C++ Source or Header  |  1993-09-17  |  7.7 KB  |  294 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Windows.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __WINDOWS__
  13. #define __WINDOWS__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19. #ifndef __EVENTS__
  20. #include <Events.h>
  21. #endif
  22.  
  23. #ifndef __CONTROLS__
  24. #include <Controls.h>
  25. #endif
  26.  
  27.  
  28. enum {
  29.  
  30.  documentProc = 0,
  31.  dBoxProc = 1,
  32.  plainDBox = 2,
  33.  altDBoxProc = 3,
  34.  noGrowDocProc = 4,
  35.  movableDBoxProc = 5,
  36.  zoomDocProc = 8,
  37.  zoomNoGrow = 12,
  38.  rDocProc = 16,
  39.  dialogKind = 2,
  40.  userKind = 8,
  41.  
  42. /*FindWindow Result Codes*/
  43.  inDesk = 0,
  44.  inMenuBar = 1,
  45.  inSysWindow = 2,
  46.  inContent = 3,
  47.  inDrag = 4,
  48.  inGrow = 5,
  49.  inGoAway = 6,
  50.  inZoomIn = 7,
  51.  inZoomOut = 8
  52. };
  53. enum {
  54.  
  55. /*window messages*/
  56.  wDraw = 0,
  57.  wHit = 1,
  58.  wCalcRgns = 2,
  59.  wNew = 3,
  60.  wDispose = 4,
  61.  wGrow = 5,
  62.  wDrawGIcon = 6,
  63.  
  64. /*defProc hit test codes*/
  65.  wNoHit = 0,
  66.  wInContent = 1,
  67.  wInDrag = 2,
  68.  wInGrow = 3,
  69.  wInGoAway = 4,
  70.  wInZoomIn = 5,
  71.  wInZoomOut = 6,
  72.  deskPatID = 16,
  73.  
  74. /*Window Part Identifiers which correlate color table entries with window elements*/
  75.  wContentColor = 0,
  76.  wFrameColor = 1,
  77.  wTextColor = 2,
  78.  wHiliteColor = 3,
  79.  wTitleBarColor = 4
  80. };
  81.  
  82.  
  83. typedef pascal void (*DragGrayRgnProcPtr)(void);
  84.  
  85. struct WindowRecord {
  86.  GrafPort port;
  87.  short windowKind;
  88.  Boolean visible;
  89.  Boolean hilited;
  90.  Boolean goAwayFlag;
  91.  Boolean spareFlag;
  92.  RgnHandle strucRgn;
  93.  RgnHandle contRgn;
  94.  RgnHandle updateRgn;
  95.  Handle windowDefProc;
  96.  Handle dataHandle;
  97.  StringHandle titleHandle;
  98.  short titleWidth;
  99.  ControlHandle controlList;
  100.  struct WindowRecord *nextWindow;
  101.  PicHandle windowPic;
  102.  long refCon;
  103. };
  104.  
  105. typedef struct WindowRecord WindowRecord;
  106. typedef WindowRecord *WindowPeek;
  107.  
  108. struct CWindowRecord {
  109.  CGrafPort port;
  110.  short windowKind;
  111.  Boolean visible;
  112.  Boolean hilited;
  113.  Boolean goAwayFlag;
  114.  Boolean spareFlag;
  115.  RgnHandle strucRgn;
  116.  RgnHandle contRgn;
  117.  RgnHandle updateRgn;
  118.  Handle windowDefProc;
  119.  Handle dataHandle;
  120.  StringHandle titleHandle;
  121.  short titleWidth;
  122.  ControlHandle controlList;
  123.  struct CWindowRecord *nextWindow;
  124.  PicHandle windowPic;
  125.  long refCon;
  126. };
  127.  
  128. typedef struct CWindowRecord CWindowRecord;
  129. typedef CWindowRecord *CWindowPeek;
  130.  
  131. struct WStateData {
  132.  Rect userState;                /*user state*/
  133.  Rect stdState;                    /*standard state*/
  134. };
  135.  
  136. typedef struct WStateData WStateData;
  137. typedef WStateData *WStateDataPtr, **WStateDataHandle;
  138.  
  139. struct AuxWinRec {
  140.  struct AuxWinRec **awNext;        /*handle to next AuxWinRec*/
  141.  WindowPtr awOwner;                /*ptr to window */
  142.  CTabHandle awCTable;            /*color table for this window*/
  143.  Handle dialogCItem;            /*handle to dialog manager structures*/
  144.  long awFlags;                    /*reserved for expansion*/
  145.  CTabHandle awReserved;            /*reserved for expansion*/
  146.  long awRefCon;                    /*user Constant*/
  147. };
  148.  
  149. typedef struct AuxWinRec AuxWinRec;
  150. typedef AuxWinRec *AuxWinPtr, **AuxWinHandle;
  151.  
  152. struct WinCTab {
  153.  long wCSeed;                    /*reserved*/
  154.  short wCReserved;                /*reserved*/
  155.  short ctSize;                    /*usually 4 for windows*/
  156.  ColorSpec ctTable[5];
  157. };
  158.  
  159. typedef struct WinCTab WinCTab;
  160. typedef WinCTab *WCTabPtr, **WCTabHandle;
  161.  
  162.  
  163. #ifdef __cplusplus
  164. extern "C" {
  165. #endif
  166. pascal void InitWindows(void)
  167.  = 0xA912; 
  168. pascal void GetWMgrPort(GrafPtr *wPort)
  169.  = 0xA910; 
  170. pascal WindowPtr NewWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  171.  Boolean visible,short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon)
  172.  = 0xA913; 
  173. pascal WindowPtr GetNewWindow(short windowID,void *wStorage,WindowPtr behind)
  174.  = 0xA9BD; 
  175. pascal void CloseWindow(WindowPtr theWindow)
  176.  = 0xA92D; 
  177. pascal void DisposeWindow(WindowPtr theWindow)
  178.  = 0xA914; 
  179. void setwtitle(WindowPtr theWindow,char *title); 
  180. pascal void GetWTitle(WindowPtr theWindow,Str255 title)
  181.  = 0xA919; 
  182. pascal void SelectWindow(WindowPtr theWindow)
  183.  = 0xA91F; 
  184. pascal void HideWindow(WindowPtr theWindow)
  185.  = 0xA916; 
  186. pascal void ShowWindow(WindowPtr theWindow)
  187.  = 0xA915; 
  188. pascal void ShowHide(WindowPtr theWindow,Boolean showFlag)
  189.  = 0xA908; 
  190. pascal void HiliteWindow(WindowPtr theWindow,Boolean fHilite)
  191.  = 0xA91C; 
  192. pascal void BringToFront(WindowPtr theWindow)
  193.  = 0xA920; 
  194. pascal void SendBehind(WindowPtr theWindow,WindowPtr behindWindow)
  195.  = 0xA921; 
  196. pascal WindowPtr FrontWindow(void)
  197.  = 0xA924; 
  198. pascal void DrawGrowIcon(WindowPtr theWindow)
  199.  = 0xA904; 
  200. pascal void MoveWindow(WindowPtr theWindow,short hGlobal,short vGlobal,
  201.  Boolean front)
  202.  = 0xA91B; 
  203. pascal void SizeWindow(WindowPtr theWindow,short w,short h,Boolean fUpdate)
  204.  = 0xA91D; 
  205. pascal void ZoomWindow(WindowPtr theWindow,short partCode,Boolean front)
  206.  = 0xA83A; 
  207. pascal void InvalRect(const Rect *badRect)
  208.  = 0xA928; 
  209. pascal void InvalRgn(RgnHandle badRgn)
  210.  = 0xA927; 
  211. pascal void ValidRect(const Rect *goodRect)
  212.  = 0xA92A; 
  213. pascal void ValidRgn(RgnHandle goodRgn)
  214.  = 0xA929; 
  215. pascal void BeginUpdate(WindowPtr theWindow)
  216.  = 0xA922; 
  217. pascal void EndUpdate(WindowPtr theWindow)
  218.  = 0xA923; 
  219. pascal void SetWRefCon(WindowPtr theWindow,long data)
  220.  = 0xA918; 
  221. pascal long GetWRefCon(WindowPtr theWindow)
  222.  = 0xA917; 
  223. pascal void SetWindowPic(WindowPtr theWindow,PicHandle pic)
  224.  = 0xA92E; 
  225. pascal PicHandle GetWindowPic(WindowPtr theWindow)
  226.  = 0xA92F; 
  227. pascal Boolean CheckUpdate(EventRecord *theEvent)
  228.  = 0xA911; 
  229. pascal void ClipAbove(WindowPeek window)
  230.  = 0xA90B; 
  231. pascal void SaveOld(WindowPeek window)
  232.  = 0xA90E; 
  233. pascal void DrawNew(WindowPeek window,Boolean update)
  234.  = 0xA90F; 
  235. pascal void PaintOne(WindowPeek window,RgnHandle clobberedRgn)
  236.  = 0xA90C; 
  237. pascal void PaintBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  238.  = 0xA90D; 
  239. pascal void CalcVis(WindowPeek window)
  240.  = 0xA909; 
  241. pascal void CalcVisBehind(WindowPeek startWindow,RgnHandle clobberedRgn)
  242.  = 0xA90A; 
  243. pascal long GrowWindow(WindowPtr theWindow,Point startPt,const Rect *bBox)
  244.  = 0xA92B; 
  245. Boolean trackgoaway(WindowPtr theWindow,Point *thePt); 
  246. pascal short FindWindow(Point thePoint,WindowPtr *theWindow)
  247.  = 0xA92C; 
  248. short findwindow(Point *thePoint,WindowPtr *theWindow); 
  249. pascal long PinRect(const Rect *theRect,Point thePt)
  250.  = 0xA94E; 
  251. pascal long DragGrayRgn(RgnHandle theRgn,Point startPt,const Rect *limitRect,
  252.  const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc)
  253.  = 0xA905; 
  254. pascal Boolean TrackBox(WindowPtr theWindow,Point thePt,short partCode)
  255.  = 0xA83B; 
  256. pascal void GetCWMgrPort(CGrafPtr *wMgrCPort)
  257.  = 0xAA48; 
  258. void getwtitle(WindowPtr theWindow,char *title); 
  259. pascal void SetWinColor(WindowPtr theWindow,WCTabHandle newColorTable)
  260.  = 0xAA41; 
  261. pascal Boolean GetAuxWin(WindowPtr theWindow,AuxWinHandle *awHndl)
  262.  = 0xAA42; 
  263. long growwindow(WindowPtr theWindow,Point *startPt,const Rect *bBox); 
  264. pascal void SetDeskCPat(PixPatHandle deskPixPat)
  265.  = 0xAA47; 
  266. WindowPtr newwindow(void *wStorage,const Rect *boundsRect,char *title,Boolean visible,
  267.  short theProc,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  268. pascal WindowPtr NewCWindow(void *wStorage,const Rect *boundsRect,ConstStr255Param title,
  269.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon)
  270.  = 0xAA45; 
  271. WindowPtr newcwindow(void *wStorage,const Rect *boundsRect,char *title,
  272.  Boolean visible,short procID,WindowPtr behind,Boolean goAwayFlag,long refCon); 
  273. pascal WindowPtr GetNewCWindow(short windowID,void *wStorage,WindowPtr behind)
  274.  = 0xAA46; 
  275. pascal short GetWVariant(WindowPtr theWindow)
  276.  = 0xA80A; 
  277. long pinrect(const Rect *theRect,Point *thePt); 
  278. #define GetGrayRgn() (* (RgnHandle*) 0x09EE)
  279. pascal void SetWTitle(WindowPtr theWindow,ConstStr255Param title)
  280.  = 0xA91A; 
  281. Boolean trackbox(WindowPtr theWindow,Point *thePt,short partCode); 
  282. pascal Boolean TrackGoAway(WindowPtr theWindow,Point thePt)
  283.  = 0xA91E; 
  284. pascal void DragWindow(WindowPtr theWindow,Point startPt,const Rect *boundsRect)
  285.  = 0xA925; 
  286. long draggrayrgn(RgnHandle theRgn,Point *startPt,const Rect *boundsRect,
  287.  const Rect *slopRect,short axis,DragGrayRgnProcPtr actionProc); 
  288. void dragwindow(WindowPtr theWindow,Point *startPt,const Rect *boundsRect); 
  289. #ifdef __cplusplus
  290. }
  291. #endif
  292.  
  293. #endif
  294.